package com.itce.arco.practicenote.day01.practice2;

public class Student extends Person {
    int number;
    String address = "广州";
// 无参构造函数
    public Student () {
        System.out.println("子类的无参构造执行了");
    }
//    有参构造函数
    public Student (String name, int age, int number) {
        super(name,age);
        this.number = number;
        System.out.println("子类的有参构造执行了");
    }
//    变量的就近原则
    public void variable () {
        String address = "杭州";
        System.out.println(address);
        System.out.println(this.address);
        System.out.println(super.address);
    }
    public void show () {
        super.show();
        System.out.println("学号：" + number);
    }
}
